package helper;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.Random;


public class genUserList {

	static String[] fname = {"jack", "tom", "paul", "mike", "peter", "sam", "charles", "mary", "john", "bill", "robert", "michael", "david", "chris", "mark"};
	static String[] lname = {"jones", "smith", "johnson", "williams", "brown", "davis", "miller", "wilson", "moore", "gates", "anderson", "thomas", "jackson", "white", "harris", "martinez"};
	static String[] classes = {"TACCT210", "TBECON220", "TBGEN100", "TFIN428", "TMGMT430", "TBUS300", "TBUS320", "TBUS350", "TBUS400", "TBUS500", "TBUS568", "TBUS569"};
	//static String[] sections = {"MW", "T", "A", "A", "B", "C", "D"};
	static int[] stime = {800, 1020, 1330, 1615, 1830 };
	//static int[] day = {0, 1, 2}; //0 = mw, 1 = tues thurs, 2 = friday
	static String[] dow = {"MW", "TR", "F"};
	private static final int size = 500000;
	
		
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		fileOutput();
	}
	
	

	
	private static void fileOutput() {
		 FileOutputStream aFileOutStream;
	     PrintStream aPrintStream; 

	        try
	        { 
	                aFileOutStream = new FileOutputStream("users.csv");

	                aPrintStream = new PrintStream( aFileOutStream );
	                
	                aPrintStream.append("#0\n");//students
	                
	                for(int i = 0; i <= size; i++)
	                {
	                    aPrintStream.append(fname[(int) (Math.random() * fname.length)] + "_");
	                    aPrintStream.append(lname[(int) (Math.random() * lname.length)]);
	                    aPrintStream.append(",");
	                  
	                    aPrintStream.append(classes[(int) (Math.random() * classes.length)] + ",");
	       
	                    aPrintStream.append(dow[(int) (Math.random() * dow.length)] + ",");
	                    int start = stime[(int) (Math.random() * stime.length)];
	                    aPrintStream.append(start + ",");
	                    aPrintStream.append(start + 205 + "");
	                    	 
	                    
	                    aPrintStream.append("\n");
	                }
	                
	                
	                aPrintStream.append("#1\n");//teachers
	                
	                for(int i = 0; i <= Math.round(size * .25); i++)
	                {
	                	
	     	           
	                    aPrintStream.append(fname[(int) (Math.random() * fname.length)] + "_");
	                    aPrintStream.append(lname[(int) (Math.random() * lname.length)]);
	                    aPrintStream.append(",");
	                  
	                    aPrintStream.append(classes[(int) (Math.random() * classes.length)] + ",");
	       
	                    aPrintStream.append(dow[(int) (Math.random() * dow.length)] + ",");
	                    int start = stime[(int) (Math.random() * stime.length)];
	                    aPrintStream.append(start + ",");
	                    aPrintStream.append(start + 205 + "");
	                    	 
	                    
	                    aPrintStream.append("\n");
	                }
	                
	                aPrintStream.append("#2\n");//advisors
	                
	                for(int i = 0; i <= Math.round(size * .1); i++)
	                {
	                	
	     	           
	                    aPrintStream.append(fname[(int) (Math.random() * fname.length)] + "_");
	                    aPrintStream.append(lname[(int) (Math.random() * lname.length)]);
	                    aPrintStream.append(",");
	                  
	                    aPrintStream.append(classes[(int) (Math.random() * classes.length)] + ",");
	       
	                    aPrintStream.append(dow[(int) (Math.random() * dow.length)] + ",");
	                    int start = stime[(int) (Math.random() * stime.length)];
	                    aPrintStream.append(start + ",");
	                    aPrintStream.append(start + 205 + "");
	                    	 
	                    
	                    aPrintStream.append("\n");
	                }
	                
	               
	                aPrintStream.close();
	                System.out.println("done...");
	        }
	        catch (Exception e)
	        {
	                System.err.println ("Error writing to file");
	        }
		
	}
	
	
	

}
